package kr.co.doriclassic.powerjava.chapter12.poly;

public class ShapeTest {
	private static Shape[] s = new Shape[3];//부모형의 객체 3개 생성
	public static void main(String[] args) {
		init();//객체생성부
		drawShape();//실행부
	}
	
	public static void init(){
		
		s[0] = new Rectangle();//사각형 객체
		s[1] = new Circle();//원객체
		s[2] = new Triangle();//삼각형객체	
	}
	
	public static void drawShape(){
		for (Shape shape : s) {
			shape.draw();//shape[0].draw(); shape[1].draw; shape[2].draw;
		}
	}
}
